// app.js
App({
  onLaunch() {

    if(!wx.cloud){
      console.error("请使用2.2.3以上版本云服务能力！")
    }else{
      wx.cloud.init({
        //env:'cloud1-8garo7nra9b04e84',
        traceUser:true,
      })
    }
    this.globalData = {}

    const db = wx.cloud.database({
      env:"cloud1-8garo7nra9b04e84"
    })
    
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  },
  globalData: {
    userInfo: null
  }
})
